import { NgModule, Inject } from '@angular/core';
import { SharedModule } from '@shared';
import { ALAIN_I18N_TOKEN } from '@delon/theme';
import { I18NService } from '@core';
import { default as zh_CN } from './_i18n/zh-CN';
import { default as en_US } from './_i18n/en-US';
import { WebMsgRoutingModule } from './msg-routing.module';
import { WebMsgLayoutComponent } from './_layout/layout.component';
import { MsgMetaComponent } from './meta/msg-meta.component';
import { MsgMetaModalComponent } from './meta/edit/msg-meta-modal.component';
import { StragegySelectModalComponent } from './components/strategy/strategy-modal.component';
import { MsgSenderComponent } from './tool/msg-sender.component';

const COMPONENTS = [WebMsgLayoutComponent, MsgMetaComponent, MsgSenderComponent];
const COMPONENTS_NOROUNT = [MsgMetaModalComponent, StragegySelectModalComponent];

@NgModule({
  imports: [SharedModule, WebMsgRoutingModule],
  declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT],
  entryComponents: COMPONENTS_NOROUNT,
})
export class WebMsgModule {
  constructor(@Inject(ALAIN_I18N_TOKEN) i18n: I18NService) {
    i18n.load('zh-CN', zh_CN);
    i18n.load('en-US', en_US);
  }
}
